<!DOCTYPE html>
<html>
	<head>
		<title>菜单预览</title>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<!-- 所有的 css & js 资源 -->
		<link rel="stylesheet" href="https://unpkg.com/element-ui@2.13.0/lib/theme-chalk/index.css">
		<link rel="stylesheet" href="../../static/sa.css"> 
		<script src="https://unpkg.com/vue@2.6.10/dist/vue.min.js"></script>
		<script src="https://unpkg.com/element-ui@2.13.0/lib/index.js"></script>
		<script src="https://unpkg.com/jquery@3.4.1/dist/jquery.min.js"></script>
		<script src="https://www.layuicdn.com/layer-v3.1.1/layer.js"></script>
		<script src="../../static/sa.js"></script>
        <style>
			body,.el-tree{background-color: #eee;}
			.el-tree-node{margin: 0.15em 0 !important;}
			/* 悬浮时颜色更深一点 */
			.el-tree-node__content:hover{background-color: #CFE8FC !important;}
        </style>
	</head>
	<body>
		<div class="vue-box" style="display: none;" :style="'display: block;'">
			<!-- 表格 -->
			<div style="padding: 0 1em;">
				<div class="c-title">菜单预览</div>
		        <!-- 树插件 -->
				<el-tree
					ref="tree"
					:data="dataList"
					node-key="id"
					:default-expand-all="true"
					>
					<span class="custom-tree-node" slot-scope="s">
						<span style="color: #2D8CF0;" v-if="s.data.isShow == undefined || s.data.isShow == true">{{ s.data.name }}</span>
						<span style="color: #999;" v-if="s.data.isShow == false">{{ s.data.name }} (隐藏)</span>
						<span style="color: #999;" v-if="s.data.info">&emsp;———— {{s.data.info}} </span>
					</span>
				</el-tree>
				<br><br><br>
			</div>
		</div>
		<script src="../../sa-frame/menu-list.js"></script>
		<script src="../../sa-frame/menu-list-sp.js"></script>
		<script src="../../sa-frame/index/admin-util.js"></script>
        <script>
			var app = new Vue({
				el: '.vue-box',
				data: {
					dataList: [],	// 数据集合 
				},
				created: function(){
					// 全部
					sa.ajax2('/SysMenu/getList', function(res){
						menuList = sa_admin_code_util.arrayToTree(menuList);	// 一维转tree 
						menuList = sa_admin_code_util.refMenuList(menuList);	// 属性处理 
						this.dataList = menuList;	// 数据  
					}.bind(this));
				}
			})
		</script>
	</body>
</html>